/*
ID: guoxu1
PROG: hamming
LANG: C++
*/
#include <fstream>
#include <vector>
using namespace std;

int dis( int a, int b )
{
	int x = a ^ b;
	int d = 0;
	while( x > 0 )
	{
		x &= ( x - 1 );
		d++;
	}
	return d;
}

#define cin fin
#define cout fout

int main()
{
	ifstream fin( "hamming.in" );
	ofstream fout( "hamming.out" );

	int N = 0, B = 0, D = 0;
	cin >> N >> B >> D;

	int max = 1 << B;
	vector<int> st( max, 0 );

	for(int s = 0; s <= max - N; s++)
	{
		//begin from s
		int count = 0;
		for(int i = s; i < max; i++)
		{
			bool pass = true;
			for(int j = 0; j < count; j++)
			{
				if( dis( st[j], i ) < D )
				{
					pass = false;
					break;
				}
			}
			if( pass )
			{
				st[count++] = i;
			}
		}
		if( count >= N )
		{
			for(int i = 0; i < N; i++)
			{
				if( i % 10 == 0 && i != 0 ) cout << endl;
				if( i % 10 != 0 ) cout << " ";
				cout << st[i];
			}
			cout << endl;
			return 0;
		}
	}

	return 0;
}